function initERConfig(diagramId,nodeDataArray,linkDataArray) {
	 var $ = go.GraphObject.make;  // for conciseness in defining templates
	    myDiagram =
	      $(go.Diagram, diagramId,  // must name or refer to the DIV HTML element
	        { initialContentAlignment: go.Spot.Center,
	          allowDelete: false,
	          allowCopy: false,
	          layout: $(go.ForceDirectedLayout) });

	    // define several shared Brushes
	    var lightgrad = $(go.Brush, go.Brush.Linear, { 1: "#E6E6FA", 0: "#FFFAF0" });

	    // the template for each attribute in a node's array of item data
	    var itemTempl =
	      $(go.Panel, "Horizontal",
	        $(go.Shape,
	          { desiredSize: new go.Size(10, 10) },
	          new go.Binding("figure", "figure"),
	          new go.Binding("fill", "color")),
	        $(go.TextBlock,
	          { stroke: "#333333",
	            font: "bold 14px sans-serif" },
	          new go.Binding("text", "", go.Binding.toString))
	      );

	    // define the Node template, representing an entity
	    myDiagram.nodeTemplate =
	      $(go.Node, "Auto",  // the whole node panel
	        { selectionAdorned: true,
	          resizable: true,
	          layoutConditions: go.Part.LayoutStandard & ~go.Part.LayoutNodeSized,
	          fromSpot: go.Spot.AllSides,
	          toSpot: go.Spot.AllSides,
	          isShadowed: true,
	          shadowColor: "#C5C1AA" },
	        new go.Binding("location", "location").makeTwoWay(),
	        // define the node's outer shape, which will surround the Table
	        $(go.Shape, "Rectangle",
	          { fill: lightgrad, stroke: "#756875", strokeWidth: 3 }),
	        $(go.Panel, "Table",
	          { margin: 8, stretch: go.GraphObject.Fill },
	          $(go.RowColumnDefinition, { row: 0, sizing: go.RowColumnDefinition.None }),
	          // the table header
	          $(go.TextBlock,
	            { row: 0, alignment: go.Spot.Center,
	              font: "bold 16px sans-serif" },
	            new go.Binding("text", "key")),
	          // the list of Panels, each showing an attribute
	          $(go.Panel, "Vertical",
	            { row: 1,
	              padding: 3,
	              alignment: go.Spot.TopLeft,
	              defaultAlignment: go.Spot.Left,
	              stretch: go.GraphObject.Horizontal,
	              itemTemplate: itemTempl },
	            new go.Binding("itemArray", "items"))
	        )  // end Table Panel
	      );  // end Node

	    // define the Link template, representing a relationship
	    myDiagram.linkTemplate =
	      $(go.Link,  // the whole link panel
	        { selectionAdorned: true,
	          layerName: "Foreground",
	          reshapable: true,
	          routing: go.Link.AvoidsNodes,
	          corner: 5,
	          curve: go.Link.JumpOver },
	        $(go.Shape,  // the link shape
	          { isPanelMain: true,
	            stroke: "#303B45",
	            strokeWidth: 2.5 }),
	        $(go.TextBlock,  // the "from" label
	          { textAlign: "center",
	            font: "bold 14px sans-serif",
	            stroke: "#1967B3",
	            segmentIndex: 0,
	            segmentOffset: new go.Point(NaN, NaN),
	            segmentOrientation: go.Link.OrientUpright },
	          new go.Binding("text", "text")),
	        $(go.TextBlock,  // the "to" label
	          { textAlign: "center",
	            font: "bold 14px sans-serif",
	            stroke: "#1967B3",
	            segmentIndex: -1,
	            segmentOffset: new go.Point(NaN, NaN),
	            segmentOrientation: go.Link.OrientUpright },
	          new go.Binding("text", "toText"))
	      );

	    myDiagram.model = new go.GraphLinksModel(JSON.parse(nodeDataArray), JSON.parse(linkDataArray));

	    myDiagram.model.undoManager.isEnabled = true;
}
    
